package com.xzz.clound.consumer.order.controller;

import com.xzz.cloud.entity.CommonResult;
import com.xzz.cloud.entity.Payment;
import com.xzz.clound.consumer.order.service.PaymentFeignService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author: hhz
 * @createDate: 2021-4-1
 */
@RestController
@Slf4j
public class OrderController {
    @Resource
    private PaymentFeignService paymentFeignService;

    @GetMapping(value = "/consumer/payment/get/{id}")
    public CommonResult<Payment> getPaymentById(@PathVariable(value = "id")Long id) {
        return paymentFeignService.getPaymentById(id);
    }

    @GetMapping(value = "/consumer/payment/feign/timeout")
    public String paymentFeignTimeOut(){
        //客户端一般默认一秒等待时间
        return paymentFeignService.paymentFeignTimeOut();
    }

}
